home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / BBS-Archive / Comm / AmiTCP30b2.lha / src / appl / napsaterm / misc.c < prev    next >
C/C++ Source or Header  |  1994-05-14  |  1KB  |  49 lines

  1. RCS_ID_C "$Id: misc.c,v 3.1 1994/01/07 22:51:24 ppessi Exp $";
  2. /* misc.c -- collection of generic useful functions used by niftyterm
  3.  *
  4.  * Copyright 1988, 1989 Chris Newman
  5.  * All Rights Reserved
  6.  * Permission is granted ot copy, modify, and use this as long
  7.  * as this notice remains intact.  This is a nifty program.
  8.  *
  9.  * $Author: ppessi $ $Revision: 3.1 $ $Date: 1994/01/07 22:51:24 $
  10.  */
  11.  
  12. #include <stdio.h>
  13. #include <ctype.h>
  14. #include "nifty.h"
  15. #include "amiga.h"
  16.  
  17. extern struct timerequest *tr;
  18.  
  19. /* a string compare which ignores case
  20.  */
  21. int lstrncmp(register char *str1, register char *str2, register int len)
  22. {
  23.   return Strnicmp(str1, str2, len);
  24. }
  25.  
  26. /* This sleeps for a given amount of microseconds
  27.  */
  28. void udelay(unsigned long val)
  29. {
  30.   Delay(val / (1000000 / 50));
  31. }
  32.  
  33. /* simple procedure to convert decimal number of 
  34.  * less than 16 digits to a string.
  35.  */
  36. char *itos(register long n)
  37. {
  38.   static char    sbuf[16];
  39.   register char  *cp = sbuf + sizeof(sbuf) - 1;
  40.  
  41.   *cp = '\0';
  42.   do {
  43.     cp--;
  44.     *cp = "0123456789"[n % 10];
  45.     n /= 10;
  46.   } while (n != 0);
  47.   return (cp);
  48. }
  49.